package net.funtip.ormgenerator.model;

public class FinderOperation {

	public enum FinderOperationType {equal, notEqual, lessThan, greaterThan}
	
	private Finder finder;
	private FinderOperationType type;
	private Attribute attribute;
	private String paramName;
	
	public FinderOperation(Finder finder, Attribute attribute) {
		super();
		this.finder = finder;
		this.attribute = attribute;
		this.type = FinderOperationType.equal;
		this.paramName = attribute.getName();
		finder.addFinderOperation(this);
	}

	public Finder getFinder() {
		return finder;
	}
	
	public void setFinder(Finder finder) {
		this.finder = finder;
	}
	
	public FinderOperationType getType() {
		return type;
	}
	
	public void setType(FinderOperationType type) {
		this.type = type;
	}

	public Attribute getAttribute() {
		return attribute;
	}

	public void setAttribute(Attribute attribute) {
		this.attribute = attribute;
	}
	
	public boolean isTypeNotEqual() {
		return type.equals(FinderOperationType.notEqual);
	}

	public boolean isTypeLessThan() {
		return type.equals(FinderOperationType.lessThan);
	}

	public boolean isTypeGreaterThan() {
		return type.equals(FinderOperationType.greaterThan);
	}

	public String getParamName() {
		return paramName;
	}

	public void setParamName(String paramName) {
		this.paramName = paramName;
	}
	
}
